{extend name="default/base" /}

{block name="title"}{cms:title /}{/block}
{block name="keywords"}{cms:keywords /}{/block}
{block name="description"}{cms:description /}{/block}

{block name="css"}{/block}

{block name="content"}
<div class="row">

    <div class="col-sm-8">
          <div class="box box-solid">
            <div class="box-body no-padding">
              <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
                <ol class="carousel-indicators">
                    {cms:slider name='vo'}
                    <li data-target="#carousel-example-generic" data-slide-to="{$key}" class="{eq name="key" value="0"}active{/eq}"></li>
                    {/cms:slider}
                </ol>
                <div class="carousel-inner">
                  {cms:slider name='vo'}
                  <div class="item {eq name="key" value="0"}active{/eq}">
                    <a href="{$vo.url}"><img src="{$vo.image}" alt="{$vo.caption}"></a>
                    <div class="carousel-caption">
                      {$vo.caption}
                    </div>
                  </div>
                  {/cms:slider}
                </div>
                <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
                  <span class="fa fa-angle-left"></span>
                </a>
                <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
                  <span class="fa fa-angle-right"></span>
                </a>
              </div>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
          {article:position name='re' recommend='1' order='id desc' limit='1'}
          <div class="box box-solid">
            <div class="box-body">
            <p class="lead">
                <a href="{$re.category_url}"><span class="text-red">[{$re.category_name}]</span> </a>
                <a href="{$re.article_url}">{$re.title}</a>
            </p>
            <div class="small text-muted">{$re.description|msubstr=0,90}</div>
            </div>
          </div>
          {/article:position}

        <div class="box box-solid">
          <div class="box-header with-border">
            <h3 class="box-title">最新发布</h3>
          </div>
          <div class="box-body no-padding">
            <ul class="nav nav-pills nav-stacked">
              {article:list name='vo' order='id desc' limit='5'}
              <li class="pad">
                    <div class="row pad">
                      <div class="col-xs-4">
                            <a href="{$vo.article_url}">
                              <img class="img-responsive" src="{cms:thumb file="$vo['image']" width="220" height="150"/}">
                            </a>
                      </div>
                      <div class="col-xs-8">
                            <div>
                                <span class="lead"><a href="{$vo.article_url}">{$vo.title}</a></span>
                                <div class="text-muted small">
                                    <span><i class="fa fa-fw fa-clock-o"></i>{$vo.create_at|format_date}</span>
                                    <!-- <span style="margin-left:10px;"><i class="fa fa-fw fa-tag"></i><a href="{$vo.category_url}">{$vo.category_name}</a></span> -->
                                    <span style="margin-left:10px;"><i class="fa fa-fw fa-user"></i><a href="{$vo.member_url}">{$vo.username}</a></span>
                                    <!-- <span style="margin-left:10px;"><i class="fa fa-fw fa-eye"></i>阅读({$vo.pv})</span> -->
                                    <!-- <span style="margin-left:10px;"><i class="fa fa-fw fa-comments-o"></i>评论({$vo.comments_total})</span>  -->
                                </div>
                                <div class="text-muted hidden-xs" style="margin-top:10px;">
                                    <p class="small">{$vo.description|msubstr=0,90}</p>
                                </div>
                            </div>
                      </div>
                    </div>
              </li>
              {/article:list}
            </ul>
          </div>
          <!-- /.box-body -->
        </div>

        <div class="text-center">
            {article:page limit='5'/}
        </div>

    </div>

    <div class="col-sm-4 hidden-xs">
        <div class="box box-solid">
          <form action="{:url('index/search/index')}" role="search">
            <div class="input-group">
              <input type="text" name="keywords" class="form-control" placeholder="Search for...">
              <span class="input-group-btn">
                <button class="btn btn-primary" type="submit">全站搜索</button>
              </span>
            </div><!-- /input-group -->
          </form>
        </div>

        <div class="box box-solid">
            <div class="box-header with-border">
              <h3 class="box-title">热点</h3>
            </div>
            <div class="box-body no-padding">
              <ul class="nav nav-pills nav-stacked">
                {article:position name='hot' hot='1' order='hot desc' limit='5'}
                <li><a href="{$hot.article_url}">{$hot.title|msubstr=0,20}</a></li>
                {/article:position}
              </ul>
            </div>
            <!-- /.box-body -->
        </div>

        <div class="box box-solid">
            <div class="box-header with-border">
                <h3 class="box-title">标签</h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
                <ul class="nav nav-pills">
                    {tag:list name='vo' order='num desc' limit='10'}
                    <li role="presentation"><a href="{$vo.tag_url}">{$vo.title}</a></li>
                    {/tag:list}
                </ul>
            </div>
            <!-- /.box-body -->
        </div>

        <!-- comments box -->
        <div class="box box-solid">
            <div class="box-header with-border">
                <h3 class="box-title">最近评论</h3>
            </div>
            <div class="box-body box-comments">
                {comment:list name="vo" limit="10"}
                <div class="box-comment">
                    <!-- User image -->
                    <img class="img-circle img-sm" src="{$vo.from_avatar}">

                    <div class="comment-text">
                        <span class="username">
                            {$vo.from_username}
                            <span class="text-muted pull-right">{$vo.create_at|format_date}</span>
                        </span><!-- /.username -->
                        {$vo.content|msubstr=0,30}
                        <p>评论了《<a href="{$vo.article_url}">{$vo.article_name}</a>》</p>
                    </div>
                    <!-- /.comment-text -->
                </div>
                {/comment:list}
            </div>
            <!-- /.comments -->
        </div>
        <!-- /.box (comments box) -->

    </div>

</div>

{/block}

{block name="js"}{/block}